import Vue from 'vue'
import router from 'vue-router'

//组件模块
import sortPage from 'components/sort/sortArea'
import myPage from 'components/my/myArea'
import indexPage from 'components/home/indexArea'
import listDetails from 'components/home/listDetails'
import sortDetails from 'components/sort/sortDetails'
import loginArea from 'components/my/login'

Vue.use(router)

export default new router({
    mode: 'history',
    routes: [
        {
            path: '/',
            name: 'indexPage',
            component: indexPage,
            meta: {
                keepAlive: true, // 需要被缓存
                index: 0, // 路由层级，数值越大层级越深，以此决定转场动画的前进和后退 大于前进，小于后退
                showFooter: true,
                showHeadNav:false,
            },
        }, {
            path: '/sortPage',
            name: 'sortPage',
            component: sortPage,
            meta: {
               /* keepAlive: true,*/
                index: 0,
                showFooter: true,
                showHeadNav:false
            }
        }, {
            path: '/myArea',
            name: 'myPage',
            component: myPage,
            meta: {
                /*keepAlive: true,*/
                index: 0,
                showFooter: true,
                showHeadNav: false
            }
        },{
            path: '/listDetails',
            name: 'listDetails',
            component: listDetails,
            meta: {
              /*  keepAlive: true,*/
                index: 1,
                showFooter: false,
                showHeadNav:true,
            }
        }, {
            path: '/sortDetails',
            name: 'sortDetails',
            component: sortDetails,
            meta: {
               /* keepAlive: true,*/
                index: 1,
                showFooter: false,
                showHeadNav:true,
            }
        },
        {
            path: '/loginArea',
            name: 'loginArea',
            component: loginArea,
            meta: {
                /* keepAlive: true,*/
                index: 1,
                showFooter: false,
                showHeadNav:false,
            }
        }
    ]
});
